package com.gome.ocean.dao.model.datax;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

import com.gome.ocean.dao.model.authority.BaseOnProjectEntity;


/**
 * 任务基本属性
 * 
 * @author haqiaolong 2016年4月14日 上午9:48:41
 * @since 5.0.0
 */
public class ScheduledJobTaskVO extends BaseOnProjectEntity {

    /**
     * 
     */
    private static final long serialVersionUID = -1929040840871609768L;

    protected String          jobName;

    protected String          jobGroup;

    /** 所属资源组，以后变为非null */
    protected String          pipelineName;

    /** 表达式 */
    protected String          cronExpression;

    public String getJobName() {
        if (StringUtils.isNotEmpty(jobName)) {
            return jobName;
        } else {
            return String.valueOf(super.getId());
        }
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        if (StringUtils.isNotEmpty(jobGroup)) {
            return jobGroup;
        } else {
            return this.pipelineName;
        }
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getPipelineName() {
        return this.pipelineName;
    }

    public void setPipelineName(String pipelineName) {
        this.pipelineName = pipelineName;
    }

    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

}
